@echo off
if "%1" == "" goto usage
if "%2" == "" goto usage
vxsys %1
if errorlevel 1 goto sysfail
if exist %1bootrom.sys del %1bootrom.sys
vxcopy %2 %1bootrom.sys
if errorlevel 1 goto copyfail
echo System tranferred.  Checking %1BOOTROM.SYS is contiguous
echo chkdsk %1bootrom.sys
chkdsk %1bootrom.sys
goto end


:sysfail
echo Failed to install boot sector on drive %1!
goto usage

:copyfail
echo Failed to copy %2 to %1BOOTROM.SYS!

:usage
echo Usage: mkboot drive: bootfile (e.g. mkboot a: vxworks.st)
echo Installs VxWorks boot sector on drive, and copies over bootfile
echo as boot image BOOTROM.SYS, stripping the 32 byte a.out header.
echo Note: BOOTROM.SYS must be contiguous or the boot will fail.  This can
echo be verified with CHKDSK.

:end
